package com.cxl.demo.mapper;

import com.cxl.demo.vo.Logistics;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface LogisticsMapper {


    @Insert("insert into logistics(buyHistoryId,createTime,content) " +
            "values(#{buyHistoryId},#{createTime},#{content})")

    Integer Add(Logistics logistics);


    @Select("select * from logistics")
    List<Logistics>  getLogistics();

    @Select("select * from logistics where buyHistoryId=#{buyHistoryId}")
    List<Logistics>  getHistoryList(Integer buyHistoryId);

    @Select("select count(1) from logistics where buyHistoryId=#{buyHistoryId}")
    Integer getHistoryNum(Integer buyHistoryId);









}
